<template>
	<view>
		<!-- <image class="container1" src="/static/logo.png"></image>
		<view class="title">
			欢迎使用 律师人工智能办案系统
		</view>
		
		<view class="viewTinputT flex-row-space-between">
			<view class="flex-row-flex-start" style="width: 116rpx;">
				<view class="bianhao">
					+86
				</view>
				<image src="/static/login_down.png" style="width: 14rpx;height: 8rpx;margin-left: 14rpx;"></image>
			</view>
			<input class="inputT" v-model="mobile" type="number" style="width: 502rpx;" placeholder="请输入手机号" />
		</view> -->
		<view class="viewTinputT">
			<view class="viewT">
				真实姓名
			</view>
			<input placeholder="请输入姓名" v-model="captcha" style="width: 618rpx;margin-top: 16rpx;"/>
		</view>
		<view class="viewTinputT">
			<view class="viewT">
				授权手机号
			</view>
			<view class="flex-row-space-between">
				<input placeholder="手机号" v-model="captcha" style="width: 500rpx;margin-top: 16rpx;">
				<button plain="true" style="font-family: PingFang SC, PingFang SC;font-weight: 400;font-size: 26rpx;color: #EE4A45;background-color: white;border: 1rpx solid #fff;">
					授权
				</button>
			</view>
			
		</view>
		<view class="viewTinputT flex-row-space-between" style="padding-top: 30rpx;padding-bottom: 32rpx;">
			<view class="viewT">
				律所全称
			</view>
			<input placeholder="请选择" disabled="true" v-model="captcha" style="width: 482rpx;text-align: end;padding-right: 20rpx;"/>
			
			</input>
		</view>
		<view class="picTitle">
			身份证
		</view>
		<view class="flex-row-center">
			<image src="/static/shenfenzheng_zhengmian.png" style="width: 290rpx;height: 200rpx;border-radius: 10rpx 10rpx 10rpx 10rpx;"></image>
			<image src="/static/shenfenzheng_fanmian.png" style="width: 290rpx;height: 200rpx;border-radius: 10rpx 10rpx 10rpx 10rpx;margin-left: 30rpx;"></image>
		</view>
		<view class="picTitle">
			律师证
		</view>
		<image src="/static/upload_lvshizheng.png" style="width: 290rpx;height: 200rpx;border-radius: 10rpx 10rpx 10rpx 10rpx;margin-left: 70rpx;"></image>
		<view class="picTitle">
			律师/助理在所证明
		</view>
		<image src="/static/zaisuozhengming.png" style="width: 290rpx;height: 200rpx;border-radius: 10rpx 10rpx 10rpx 10rpx;margin-left: 70rpx;"></image>
		<view style="height: 160rpx;"></view>
		<view class="fixed-bottom" style="height: 140rpx;background-color: white;">
			<view @click="loginMobile()" class="loginButton">
				提交认证
			</view>
			<!-- <view class="flex-row-center" style="margin-top: 8rpx;">
				<image @click="isTongClick" :src="isTong==true?'/static/tabbarItem/tab1_1.png':'/static/tabbarItem/tab1.png'" style="width: 32rpx;height: 32rpx;"></image>
				<view style="font-family: PingFang SC, PingFang SC;font-weight: 500;font-size: 28rpx;color: #333333;margin-left: 8rpx;">
					我同意用户相关协议
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isTong:false,
				mobile: '',
				captcha: ''
			}
		},
		onShow() {

		},
		onLoad() {

		},
		methods: {
			forgetPasswordClick(){
				uni.navigateTo({
					url:'/pages/forgetPassword/forgetPassword'
				})
			},
			registerClick(){
				uni.navigateTo({
					url:'/pages/register/register'
				})
			},
			loginMobile() {
				if (!(/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.mobile))) {
					uni.showToast({
						title: '请输入正确的手机号',
						icon: 'none'
					});
					return false;
				}
				if(!this.captcha.length){
					this.showToast('请输入验证码')
					return
				}
				let param = {
					'url': 'api/user/mobilelogin',
					'data': {
						mobile: this.mobile,
						captcha: this.captcha
					},
					'method': 'POST'
				}
				uni.showLoading({})
				this.$myRequest(param).then(res => {
					uni.hideLoading()
					if (res.code == 1) {
						this.showToast('登录成功')
						uni.setStorageSync('userinfo', res.data.userinfo)
						uni.setStorageSync('token', res.data.userinfo.token)
						setTimeout(() => {
							uni.switchTab({
								url: "/pages/index/index"
							})
						}, 1500)
					} else {
						if(res.msg){
							this.showToast(res.msg)
						}else{
							this.showToast('登录失败')
						}
					}
				})
			},
			showToast(title) {
				uni.showToast({
					title: title,
					icon: 'none'
				})
			},
			isTongClick(){
				this.isTong = !this.isTong
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #fff;
	}
	.picTitle{
		padding-left: 70rpx;
		padding-top: 40rpx;
		padding-bottom: 30rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #333333;
	}
	.container1{
		margin-left: 66rpx;
		margin-top: 80rpx;
		width: 100rpx;
		height: 100rpx;
	}
	.title {
		margin-left: 66rpx;
		margin-top: 34rpx;
		margin-bottom: 32rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 800;
		font-size: 40rpx;
		color: #333333;
	}
	.viewTinputT{
		margin-left: 66rpx;
		width: 618rpx;
		padding-top: 40rpx;
		padding-bottom: 24rpx;
		border-bottom: 1rpx solid #CCCCCC;
	}
	.bianhao{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	.viewT{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #333333;
	}
	.inputT{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	
	.loginButton {
		margin-top: 10rpx;
		margin-left: 64rpx;
		width: 620rpx;
		height: 90rpx;
		background: linear-gradient( to bottom, #E93548 0%, #F35B43 100%);
		box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(235,43,59,0.4);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #FFFFFF;
		line-height: 90rpx;
		text-align: center;
	}
	
</style>
